//
//  WD_TableViewTwo.m
//  BUDING
//
//  Created by 景强 on 16/4/1.
//  Copyright © 2016年 HanWoonYong. All rights reserved.
//

#import "WD_TableViewTwo.h"

@implementation WD_TableViewTwo

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        self.imageViewAvatar = [[UIImageView alloc] initWithFrame:CGRectZero];
        self.labelNickName = [[UILabel alloc] initWithFrame:CGRectZero];
        self.labelNickName.font = [UIFont systemFontOfSize:15 weight:0.7];
        self.labelContent = [[UILabel alloc] initWithFrame:CGRectZero];
        self.labelContent.numberOfLines = 3;
        self.labelContent.font = [UIFont systemFontOfSize:13];
        [self.contentView addSubview:self.imageViewAvatar];
        [self.contentView addSubview:self.labelNickName];
        [self.contentView addSubview:self.labelContent];
        
        
        
        
        
        
        self.imageAnimeImageUrl = [[UIImageView alloc] initWithFrame:CGRectZero];
        self.labelAnimeName = [[UILabel alloc] initWithFrame:CGRectZero];
        [self.contentView addSubview:self.imageAnimeImageUrl];
        [self.contentView addSubview:self.labelAnimeName];
        
    }
    
    return self;
    
    
}


- (void)layoutSubviews {
    [super layoutSubviews];
    
    self.imageViewAvatar.frame = CGRectMake(10, 10, 90, 90);
    self.imageViewAvatar.layer.masksToBounds = YES;
    self.imageViewAvatar.layer.cornerRadius = self.imageViewAvatar.frame.size.height / 2;
    self.labelNickName.frame = CGRectMake(110, 20, self.frame.size.width - 30, 50);
    self.labelContent.frame = CGRectMake(20, 90, self.frame.size.width - 30, 80);
    
    
    self.imageAnimeImageUrl.frame = CGRectMake(20, 180, 80, 100);
    
    self.labelAnimeName.frame = CGRectMake(110, 190, self.frame.size.width - 50, 40);
    
    
    
}

- (void)setModel:(WD_OwnerModel *)model {
    
    _model = model;
    
    self.labelNickName.text = model.nickname;
    
    
    
}

- (void)setModelRelate:(WD_RelatedModel *)modelRelate {
    
    _modelRelate = modelRelate;
    self.labelContent.text = modelRelate.content;
}



- (void)setModelEp:(WD_EpModel *)modelEp {
    
    
    _modelEp = modelEp;
    
    [self.imageAnimeImageUrl sd_setImageWithURL:[NSURL URLWithString:modelEp.animeImageUrl] placeholderImage:[UIImage imageNamed:@"占位图_"]];
    
    self.labelAnimeName.text = modelEp.animeName;
    
    
}



@end
